1. Technical Field
The present invention relates in general to a system and method for using a plurality of processors to handle code. More particularly, the present invention relates to a system and method for using heterogeneous processors with one processor handling code requests on behalf of the other processor using a shared memory.
2. Description of the Related Art
Computer systems are becoming more and more complex. The computer industry typically doubles the performance of a computer system every 18 months, such as personal computers, PDAs, and gaming consoles. In order for the computer industry to accomplish this task, the semiconductor industry produces integrated circuits that double in performance every 18 months. A computer system uses an integrated circuit for particular functions based upon the integrated circuit's architecture. Two fundamental architectures are 1) a microprocessor-based architecture and 2) a digital signal processor-based architecture.
An integrated circuit with a microprocessor-based architecture is typically used to handle control operations whereas an integrated circuit with a digital signal processor-based architecture is typically designed to handle signal-processing functions (i.e. mathematical operations). As technology evolves, the computer industry and the semiconductor industry are using both architectures, or processor types, in a computer system design.
Software is another element in a computer system that has been evolving alongside integrated circuit evolution. A software developer writes code in a manner that corresponds to the processor type that executes the code. For example, a processor has a particular number of registers and a particular number of arithmetic logic units (ALUs) whereby the software developer designs his code to most effectively use the registers and the ALUs.
As the semiconductor industry incorporates multiple processor types onto a single device, and as software developers write code to execute on multiple processor type architectures, a challenge found is identifying which files to load on a particular processor type.
Executable files typically employ a runtime loader which loads dependent files onto memory. The runtime loader, however, assumes that the same processor that is executing the runtime loader executes the dependent files. In a multi-processor environment, however, this may not be the case. In addition, in a heterogeneous processor environment, the code for a particular file is formatted for a particular processor type and may not run if the code is loaded on a different processor type.
A notable exception to this, however, is an environment that uses a “virtual machine” (such as a Java Virtual Machine (JVM), so that the applications are compiled to operate using the virtual machine with each supported operating environment employing a different version of the virtual machine that operates on the operating environment. A challenge of virtual machines, however, is that they require system resources to manage the virtual environment (i.e., a garbage-collected heap, etc.) and, because the application code is being performed by a virtual machine rather than directly by a processor, virtual machine code is traditionally slower and less efficient than code that executes directly on a processor.
In gaming environments, large quantities of code are loaded to establish the game environment as well prepare for the various decisions that might be made by the user of the game. For example, if a game allowed the user to move a game character to various locations, different code to perform different effects is either loaded when the user makes the decision or at the beginning of the game. If the code is loaded when the user makes a decision, there is often a noticeable time lag as the computer system fetches the code corresponding to the user's decision from a hard drive or CD-ROM drive. If the code is loaded at the beginning of the game, lag time can be minimized but large a amount of memory is needed to store code that might not ever be used.
What is needed, therefore, is a system and method for loading and executing code as needed using a plurality of processors that work together to load and execute the code using a common (shared) memory. Furthermore, what is needed is a system and method that allows one processor to prepare instructions, such as script instructions or interpreted instructions, and feed the prepared instructions to another processor for execution.